package cn.webdai.rabbitmq.example_02;

import cn.webdai.rabbitmq.pojo.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息的接受者-----接受一个对象
 * @author 戴金华
 * @date 2019-12-04 15:51
 */
@Component
@RabbitListener(queues = "object")
public class MessageReceiver2 {

    @RabbitHandler
    public void receive(User user){
        System.out.println("接受者接受的消息内容:"+user);
    }
}
